package com.wolf.cx330.view.act

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.wolf.cx330.R
import com.wolf.cx330.base.animateView
import kotlinx.android.synthetic.main.activity_avd_anim.*

class AvdAnimAct : AppCompatActivity() {
    companion object {
        fun actionStart(context: Context) =
            context.startActivity(Intent(context, AvdAnimAct::class.java))
    }

    var viewIsStart = true
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_avd_anim)
        imageView.setOnClickListener {
            if (viewIsStart) {
                viewIsStart = false
                imageView.setImageResource(R.drawable.avd_anim_start)
            } else {
                viewIsStart = true
                imageView.setImageResource(R.drawable.avd_anim_reserve)
            }
            animateView(imageView)
        }
    }
}